package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xcmg.device.dao.entity.warehouse.DepartmentWarehouseRelationDO;

import java.util.List;

@Repository
@Mapper
public interface DepartmentWarehouseRelationMapper {
    int deleteByPrimaryKey(String id);

    int insert(DepartmentWarehouseRelationDO record);

    int insertSelective(DepartmentWarehouseRelationDO record);

    DepartmentWarehouseRelationDO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DepartmentWarehouseRelationDO record);

    int updateByPrimaryKey(DepartmentWarehouseRelationDO record);
    //查询仓库库存控制配置
    int checkWarehouseInvertoryCont(DepartmentWarehouseRelationDO record);
    //根据部门编码查询配置了仓库库存控制的数据
    List<DepartmentWarehouseRelationDO> selectInvertoryContByDeptWare(@Param("departmentId") String departmentId,@Param("orgId") String orgId);

    int delete(@Param("departmentId") String departmentId,@Param("orgId") String orgId);
    //条件查询未被删除的数据
    List<DepartmentWarehouseRelationDO> selectByDeptIdAndOrgId(DepartmentWarehouseRelationDO record);
    //查询配置的主库区
    List<DepartmentWarehouseRelationDO> selectMajorControlByDeptWare(@Param("departmentId") String departmentId,@Param("orgId") String orgId);
    //查询配置的次库区
    List<DepartmentWarehouseRelationDO> selectMinorControlByDeptWare(@Param("departmentId") String departmentId,@Param("orgId") String orgId);
}